$('#search').click(function() {
  $.getJSON('worker_add_get.php', {
      keyword: $('#keyword').val()
    },
    function(data, textStatus, jqXHR) {
      $('#hide_result').show();
      $('#ListArea').empty();
      for (let i = 0; i < data.length; i++) {
        $('#ListArea').append(
          '<tr>' +
          '  <td> ' + data[i].XingMing + ' </td> <td> ' + data[i].XueHao + ' </td> ' +
          '  <td> ' +
          '    <a person_id="' + data[i].id + '"  href="javascript:" class="btn btn-default btn-xs blue person_add"><i class="fa fa-plus"></i>增加</a> ' +
          '  </td> ' +
          '</tr> '
        );
      }
      optAction();
    }
  );
})

function optAction() {
  $('.person_add').click(function() {
    var person_id = $(this).attr('person_id');
    $.post('woker_add.php', {
        BuMenId: BuMenId,
        person_id: person_id
      },
      function(data, textStatus, jqXHR) {
        $('.mail-body').load('worker_list.html');
      }
    );
  })
}
